home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Description:
- // This script is executed when a new scene file is created. It will create
- // panels if required or use existing panels.
- //
- // Creation Date:
- // Author:
- //
-
- global proc buildNewSceneUI() {
-
- global string $gMainPane;
- global string $gNewScenePanelConfig;
- global int $gUseNewScenePanelConfig;
-
- int $menusOkayInPanels = `optionVar -q allowMenusInPanels`;
- int $useNewSceneConfig = $gUseNewScenePanelConfig;
- string $panels[] = `getPanel -all`;
-
-
- if (!$useNewSceneConfig && (size($panels) == 0)) {
- //
- // Currently no panels so use the new scene panels anyway.
- //
- $useNewSceneConfig = true;
- }
-
-
- if (`paneLayout -exists $gMainPane` && $useNewSceneConfig) {
- //
- // Start building panels for the new scene.
- //
- int $i;
- int $count = 0;
- int $nVis = `paneLayout -q -nvp $gMainPane`;
- string $type;
- string $types[4];
- string $panelName;
- string $editorName;
- string $itemFilterName;
- string $subFilter1, $subFilter2;
-
- //
- // get current state of the UI
- //
- sceneUIReplacement -update $gMainPane;
-
- // Model Views
- //
- if (`exists modelPanel`) {
-
- $panelLabel = "Top View";
- $panelName = `sceneUIReplacement -getNextPanel "modelPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `modelPanel -mbv $menusOkayInPanels
- -parent $gMainPane -l "Top View" `;
- } else {
- //
- // Use an existing panel.
- //
- modelPanel -edit -l "Top View" $panelName;
- }
- $editorName = $panelName;
- modelEditor -e
- -camera `findStartUpCamera top`
- -useInteractiveMode 0
- -displayLights "default"
- -displayAppearance "wireframe"
- -activeOnly 0
- -wireframeOnShaded 0
- -bufferMode "double"
- -twoSidedLighting 1
- -backfaceCulling 0
- -xray 0
- -st 1
- -displayTextures 0
- -textureMaxSize 1024
- -nurbsCurves 1
- -nurbsSurfaces 1
- -polymeshes 1
- -subdivSurfaces 1
- -planes 1
- -lights 1
- -cameras 1
- -joints 1
- -ikHandles 1
- -deformers 1
- -dynamics 1
- -locators 1
- -dimensions 1
- -handles 1
- -pivots 1
- -textures 1
- -fogging 0
- -shadows 0
- -smoothWireframe 0
- -viewSelected false
- $editorName;
-
- if (`isTrue "MayaCreatorExists"` &&
- (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- modelEditor -e -strokes 1 $editorName;
- }
-
- // disable isolate select auto update
- editor -edit -lck -mainListConnection "activeList" $editorName;
-
-
- $panelLabel = "Side View";
- $panelName = `sceneUIReplacement -getNextPanel "modelPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `modelPanel -mbv $menusOkayInPanels
- -parent $gMainPane -l $panelLabel`;
- } else {
- modelPanel -edit -l $panelLabel $panelName;
- }
- $editorName = $panelName;
- modelEditor -e
- -camera `findStartUpCamera side`
- -useInteractiveMode 0
- -displayLights "default"
- -displayAppearance "wireframe"
- -activeOnly 0
- -wireframeOnShaded 0
- -bufferMode "double"
- -twoSidedLighting 1
- -backfaceCulling 0
- -xray 0
- -st 1
- -displayTextures 0
- -textureMaxSize 1024
- -nurbsCurves 1
- -nurbsSurfaces 1
- -polymeshes 1
- -subdivSurfaces 1
- -planes 1
- -lights 1
- -cameras 1
- -joints 1
- -ikHandles 1
- -deformers 1
- -dynamics 1
- -locators 1
- -dimensions 1
- -handles 1
- -pivots 1
- -textures 1
- -fogging 0
- -shadows 0
- -smoothWireframe 0
- -viewSelected false
- $editorName;
-
- if (`isTrue "MayaCreatorExists"` &&
- (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- modelEditor -e -strokes 1 $editorName;
- }
-
- // disable isolate select auto update
- editor -edit -lck -mainListConnection "activeList" $editorName;
-
-
- $panelLabel = "Front View";
- $panelName = `sceneUIReplacement -getNextPanel "modelPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `modelPanel -mbv $menusOkayInPanels
- -parent $gMainPane -l $panelLabel`;
- } else {
- modelPanel -edit -l $panelLabel $panelName;
- }
- $editorName = $panelName;
- modelEditor -e
- -camera `findStartUpCamera front`
- -useInteractiveMode 0
- -displayLights "default"
- -displayAppearance "wireframe"
- -activeOnly 0
- -wireframeOnShaded 0
- -bufferMode "double"
- -twoSidedLighting 1
- -backfaceCulling 0
- -xray 0
- -st 1
- -displayTextures 0
- -textureMaxSize 1024
- -nurbsCurves 1
- -nurbsSurfaces 1
- -polymeshes 1
- -subdivSurfaces 1
- -planes 1
- -lights 1
- -cameras 1
- -joints 1
- -ikHandles 1
- -deformers 1
- -dynamics 1
- -locators 1
- -dimensions 1
- -handles 1
- -pivots 1
- -textures 1
- -fogging 0
- -shadows 0
- -smoothWireframe 0
- -viewSelected false
- $editorName;
-
- if (`isTrue "MayaCreatorExists"` &&
- (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- modelEditor -e -strokes 1 $editorName;
- }
-
- // disable isolate select auto update
- editor -edit -lck -mainListConnection "activeList" $editorName;
-
-
- $panelLabel = "Persp View";
- $panelName = `sceneUIReplacement -getNextPanel "modelPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `modelPanel -mbv $menusOkayInPanels
- -parent $gMainPane -l $panelLabel`;
- } else {
- modelPanel -edit -l $panelLabel $panelName;
- }
- $editorName = $panelName;
- modelEditor -e
- -camera `findStartUpCamera persp`
- -useInteractiveMode 0
- -displayLights "default"
- -displayAppearance "wireframe"
- -activeOnly 0
- -wireframeOnShaded 0
- -bufferMode "double"
- -twoSidedLighting 1
- -backfaceCulling 0
- -xray 0
- -st 1
- -displayTextures 0
- -textureMaxSize 1024
- -nurbsCurves 1
- -nurbsSurfaces 1
- -polymeshes 1
- -subdivSurfaces 1
- -planes 1
- -lights 1
- -cameras 1
- -joints 1
- -ikHandles 1
- -deformers 1
- -dynamics 1
- -locators 1
- -dimensions 1
- -handles 1
- -pivots 1
- -textures 1
- -fogging 0
- -shadows 0
- -smoothWireframe 0
- -viewSelected false
- $editorName;
-
- if (`isTrue "MayaCreatorExists"` &&
- (`licenseCheck -m "edit" -typ "particlePaint"`)) {
- modelEditor -e -strokes 1 $editorName;
- }
-
- // disable isolate select auto update
- editor -edit -lck -mainListConnection "activeList" $editorName;
- }
-
- if (`exists outlinerPanel`) {
-
- $panelLabel = "Outliner";
- $panelName = `sceneUIReplacement -getNextPanel "outlinerPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `outlinerPanel
- -mbv $menusOkayInPanels
- -unParent -l $panelLabel`;
- } else {
- outlinerPanel -edit -l $panelLabel $panelName;
- // Save the current state of the outliner
- //
- saveOutlinerSettings;
- }
- $editorName = $panelName;
- outlinerEditor -e
- -mainListConnection "worldList"
- -selectionConnection "modelList"
- -showShapes 0
- -showAttributes 0
- -showConnected 0
- -showAnimCurvesOnly 0
- -autoExpand 0
- -showDagOnly 1
- -ignoreDagHierarchy 0
- -expandConnections 0
- -showCompounds 1
- -showNumericAttrsOnly 0
- -highlightActive 1
- -autoSelectNewObjects 0
- -doNotSelectNewObjects 0
- -transmitFilters 0
- -showSetMembers 1
- -setFilter defaultSetFilter
- $editorName;
- // Apply any saved state settings
- //
- applyOutlinerSettings ($editorName);
- }
-
- if (`isTrue AnimationExists`) {
-
- $panelLabel = "Graph Editor";
- $panelName = `sceneUIReplacement -getNextScriptedPanel "graphEditor" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "graphEditor" -l $panelLabel`;
- } else {
- scriptedPanel -edit -l $panelLabel $panelName;
- }
- $editorName = ($panelName+"OutlineEd");
- outlinerEditor -e
- -mainListConnection "graphEditorList"
- -selectionConnection "graphEditor1FromOutliner"
- -highlightConnection "keyframeList"
- -showShapes 1
- -showAttributes 1
- -showConnected 1
- -showAnimCurvesOnly 1
- -autoExpand 1
- -showDagOnly 0
- -ignoreDagHierarchy 0
- -expandConnections 1
- -showCompounds 0
- -showNumericAttrsOnly 1
- -highlightActive 0
- -autoSelectNewObjects 1
- -doNotSelectNewObjects 0
- -transmitFilters 1
- -showSetMembers 0
- $editorName;
-
- $editorName = ($panelName+"GraphEd");
- animCurveEditor -e
- -mainListConnection "graphEditor1FromOutliner"
- -displayKeys 1
- -displayTangents 0
- -displayActiveKeys 0
- -displayActiveKeyTangents 1
- -displayInfinities 0
- -autoFit 0
- -snapTime "integer"
- -snapValue "none"
- -smoothness "fine"
- -resultSamples 1
- $editorName;
-
- $panelLabel = "Dope Sheet";
- $panelName = `sceneUIReplacement -getNextScriptedPanel "dopeSheetPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "dopeSheetPanel" -l $panelLabel`;
- } else {
- scriptedPanel -edit -l $panelLabel $panelName;
- }
- $editorName = ($panelName+"OutlineEd");
- outlinerEditor -e
- -mainListConnection "animationList"
- -selectionConnection "dopeSheetPanel1OutlinerSelection"
- -highlightConnection keyframeList
- -showShapes 1
- -showAttributes 1
- -showConnected 1
- -showAnimCurvesOnly 1
- -autoExpand 0
- -showDagOnly 0
- -ignoreDagHierarchy 0
- -expandConnections 1
- -showCompounds 1
- -showNumericAttrsOnly 1
- -highlightActive 0
- -autoSelectNewObjects 0
- -doNotSelectNewObjects 1
- -transmitFilters 0
- -showSetMembers 0
- $editorName;
-
- $editorName = ($panelName+"DopeSheetEd");
- dopeSheetEditor -e
- -mainListConnection "dopeSheetPanel1FromOutliner"
- -highlightConnection "dopeSheetPanel1OutlinerSelection"
- -displayKeys 1
- -displayTangents 0
- -displayActiveKeys 0
- -displayActiveKeyTangents 0
- -displayInfinities 0
- -autoFit 0
- -snapTime "integer"
- -snapValue "none"
- -outliner "dopeSheetPanel1OutlineEd"
- $editorName;
-
- $panelLabel = "Trax Editor";
- $panelName = `sceneUIReplacement -getNextScriptedPanel "clipEditorPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "clipEditorPanel" -l $panelLabel`;
- } else {
- scriptedPanel -edit -l $panelLabel $panelName;
- }
-
- $editorName = ($panelName+"ClipEditor");
-
- // For now, the clip editor has nothing to be changed. Leaving
- // in the edit command for future reference. -divin
- clipEditor -e
- $editorName;
- }
-
-
- if (`exists hyperGraph`) {
-
- $panelLabel = "Hypergraph";
- $panelName = `sceneUIReplacement -getNextScriptedPanel "hyperGraphPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "hyperGraphPanel" -l $panelLabel`;
- } else {
- scriptedPanel -edit -l $panelLabel $panelName;
- }
- $editorName = ($panelName+"HyperGraphEd");
- hyperGraph -e
- -image ""
- -graphType "DAG"
- $editorName;
-
- $panelLabel = "Hypershade";
- $panelName = `sceneUIReplacement -getNextScriptedPanel "hyperShadePanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "hyperShadePanel" -l $panelLabel`;
- } else {
- scriptedPanel -edit -l $panelLabel $panelName;
- }
-
- $panelLabel = "Visor";
- $panelName = `sceneUIReplacement -getNextScriptedPanel "visorPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "visorPanel" -l $panelLabel`;
- } else {
- scriptedPanel -edit -l $panelLabel $panelName;
- }
- }
-
- if (`isTrue "PolyTextureExists"`)
- {
-
- $panelLabel = "UV Texture Editor";
- $panelName = `sceneUIReplacement -getNextScriptedPanel "polyTexturePlacementPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "polyTexturePlacementPanel" -l $panelLabel`;
- } else {
- $label = `panel -q -label $panelName`;
- scriptedPanel -edit -l $panelLabel $panelName;
- }
- }
-
-
- if (`isTrue "RenderingExists"`) {
- $panelLabel = "Multilister";
- $panelName = `sceneUIReplacement -getNextScriptedPanel "multiListerPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "multiListerPanel" -l $panelLabel`;
- } else {
- $label = `panel -q -label $panelName`;
- scriptedPanel -edit -l $panelLabel $panelName;
- }
-
- if (true) {
- $panelLabel = "Render View";
- $panelName = `sceneUIReplacement -getNextScriptedPanel "renderWindowPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "renderWindowPanel" -l $panelLabel renderView`;
- } else {
- $label = `panel -q -label $panelName`;
- scriptedPanel -edit -l $panelLabel $panelName;
- }
- }
- }
-
- //if (`exists blendshapePanel`) {
- if (`isTrue DeformersExists`) {
-
- $panelLabel = "Blend Shape";
- $panelName = `sceneUIReplacement -getNextPanel "blendShapePanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `blendShapePanel -mbv $menusOkayInPanels -unParent -l $panelLabel`;
- } else {
- $label = `panel -q -label $panelName`;
- blendShapePanel -edit -l $panelLabel $panelName;
- }
- }
-
- if (`isTrue "DynamicsExists"`) {
-
- $panelLabel = "Dynamic Relationships";
- $panelName = `sceneUIReplacement -getNextScriptedPanel "dynRelEdPanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "dynRelEdPanel" -l $panelLabel`;
- } else {
- $label = `panel -q -label $panelName`;
- scriptedPanel -edit -l $panelLabel $panelName;
- }
- }
-
- if (`exists devicePanel`) {
- $panelLabel = "Devices";
- $panelName = `sceneUIReplacement -getNextPanel "devicePanel" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `devicePanel -mbv $menusOkayInPanels
- -unParent -l $panelLabel`;
- } else {
- $label = `panel -q -label $panelName`;
- devicePanel -edit -l $panelLabel $panelName;
- }
- }
-
- if (`exists relationshipEditor`) {
- $panelLabel = "Relationship Editor";
- $panelName =
- `sceneUIReplacement
- -getNextScriptedPanel"relationshipPanel"
- $panelLabel`;
-
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "relationshipPanel"
- -l $panelLabel`;
- } else {
- scriptedPanel -edit -l $panelLabel $panelName;
- }
- }
-
- if (`exists referenceEditorPanel`) {
- $panelLabel = "Reference Editor";
- $panelName =
- `sceneUIReplacement
- -getNextScriptedPanel"referenceEditorPanel"
- $panelLabel`;
-
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "referenceEditorPanel"
- -l $panelLabel`;
- } else {
- $label = `panel -q -label $panelName`;
- scriptedPanel -edit -l $panelLabel $panelName;
- }
- }
-
-
- if (`exists componentEditorPanel`) {
- $panelLabel = "Component Editor";
- $panelName =
- `sceneUIReplacement
- -getNextScriptedPanel"componentEditorPanel"
- $panelLabel`;
-
- if ("" == $panelName) {
- $panelName = `scriptedPanel -mbv $menusOkayInPanels
- -unParent -type "componentEditorPanel"
- -l $panelLabel`;
- } else {
- $label = `panel -q -label $panelName`;
- scriptedPanel -edit -l $panelLabel $panelName;
- }
- }
-
-
- if (`isTrue MayaCreatorExists`) {
- $panelLabel = "Paint Effects";
- $panelName = `sceneUIReplacement -getNextScriptedPanel "dynPaintScriptedPanelType" $panelLabel`;
- if ("" == $panelName) {
- $panelName = `scriptedPanel -unParent -type "dynPaintScriptedPanelType" -l $panelLabel dynPaintScriptedPanel`;
- } else {
- scriptedPanel -edit -l $panelLabel $panelName;
- }
- dynPaintPanel $panelName;
- }
-
- // if (`about -nt`) {
- // $panelLabel = "Help Panel";
- // $panelName = `sceneUIReplacement -getNextScriptedPanel "helpPanel" $panelLabel`;
- // if ("" == $panelName) {
- // $panelName = `scriptedPanel -unParent -type "helpPanel" -l $panelLabel`;
- // } else {
- // scriptedPanel -edit -l $panelLabel $panelName;
- // }
- // }
-
- sceneUIReplacement -deleteRemaining;
- sceneUIReplacement -clear;
-
- setNamedPanelLayout $gNewScenePanelConfig;
-
- panelHistory -e -clear mainPanelHistory;
- setFocus `paneLayout -q -p1 $gMainPane`;
-
- }
-
- }
-